package com.wiki.gds.base.web.controller.config.feign;

import feign.Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.AnnotatedParameterProcessor;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class MyFeignClientsConfiguration extends FeignClientsConfiguration {
    private List<AnnotatedParameterProcessor> parameterProcessors = new ArrayList();
    @Autowired(
            required = false
    )

    public Contract feignContract(ConversionService feignConversionService) {
        //MySpringMvcContract  配置 postMapping 自动匹配方法名
        return new MySpringMvcContract(parameterProcessors, feignConversionService);
    }
}
